package com.groupbuying.settleproducer.controller;

import com.groupbuying.settleproducer.service.SettleUshopWithdrawalService;
import com.groupbuying.settleproducer.utils.apiresult.ApiResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 *
 * @author WANGNING
 * @email wyn20140226@aliyun.com
 * @date 2019-05-13 01:53:15
 * @des 提现申请总信息
 */
@RestController
@RequestMapping("/settleUshopWithdrawal")
public class SettleUshopYSWithdrawalController {
	@Autowired
	private SettleUshopWithdrawalService settleWithdrawalService;

	/**
	 * @api {post} /settleUshopWithdrawal/createWithdrawal 商户提现接口
	 * @apiExample
	 * author WANGNING
	 * tar 调用方(store中心内部调用)
	 * date 2019-05-13 01:53:15
	 * @apiGroup SettleProducer
	 * @apiVersion 1.0.0
	 * @apiParamparams {String} ysUserStatus 0-非一清代付 2-银盛一清 1-原生打款
	 * @apiParamparams {String} withdrawalType 00-一清现金 01-一清现金+余额提现 02-余额提现
	 * @apiParamparams {String} totalAmount 提现总金额
	 * @apiParamparams {String} withdrawalId 获取提现id（从商户中心获取）
	 * @apiParamparams {String} subject 订单说明
	 * @apiParamparams {String} ysUserCode 银盛报备商户号
	 * @apiParamparams {String} totalAcountAmount 获取商户账户余额（从商户中心获取）
	 * @apiParamparams {String} bankName 银行名称
	 * @apiParamparams {String} cityName 开户行所在城市
	 * @apiParamparams {String} bankAccountNo 银行帐号
	 * @apiParamparams {String} bankAccountName 银行帐号用户名
	 * @apiParamparams {String} bankAccountType 收款方银行账户类型 corporate-对公账户 personal—对私账户
	 * @apiParamparams {String} bankCardType 支持卡类型 debit-借记卡;credit-信用卡;unit-单位结算卡
	 * @apiSuccess {Integer} code 请求结果 0-失败 1-成功
	 */
	@PostMapping("/createWithdrawal")
	public ApiResult createWithdrawal(@RequestParam Map<String, Object> params){
		return settleWithdrawalService.createWithdrawal(params);
	}

}
